import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooMinishopSpuController } from '../../../controllers';
const uctoominishopSpuRouter = new Router();
const minishopSpuController = new uctooMinishopSpuController();

uctoominishopSpuRouter.post('/add', requireUser, minishopSpuController.add);
uctoominishopSpuRouter.post('/edit', requireUser, rowLevelPermission('uctoo/minishop_spu'), minishopSpuController.edit);
uctoominishopSpuRouter.post('/del', requireUser, rowLevelPermission('uctoo/minishop_spu'), minishopSpuController.delete);

//For getting minishopSpu with permission control
uctoominishopSpuRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/minishop_spu'), minishopSpuController.getSingle);
uctoominishopSpuRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/minishop_spu'), minishopSpuController.getMany);
uctoominishopSpuRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/minishop_spu'), minishopSpuController.getMany);

//#endregion AutoCreateCode
export default uctoominishopSpuRouter;
